import request from '@/utils/request'

export function listMenu(query) {
  return request({
    url: '/library/zxm/application/list',
    method: 'get',
    params: query
  })
}

export function listMenu1(parentId) {
  return request({
    url: '/library/zxm/application/'+parentId,
    method: 'get',
  })
}

//查询全天房
export function listNormal(query) {
  return request({
    url: '/project/zxm/room/normal',
    method: 'get',
    params: query
  })
}

// 查询菜单详细
export function getUnBack() {
  return request({
    url: '/project/zxm/room/latter',
    method: 'get'
  })
}

//查询休息到时的
export function getMenu(val) {
  return request({
    url: '/project/zxm/room/other/' + val,
    method: 'get'
  })
}

//开房
export function addRoom(data) {
  return request({
    url: '/project/zxm/room/start',
    method: 'post',
    data: data
  })
}

//加钟
export function bellRoom(data) {
  return request({
    url: '/project/zxm/room/bell',
    method: 'post',
    data: data
  })
}

//换房
export function changeRoom(data) {
  return request({
    url: '/project/zxm/room/full',
    method: 'post',
    data: data
  })
}

//退房
export function updateRoom(data) {
  return request({
    url: '/project/zxm/room/end',
    method: 'post',
    data: data
  })
}

//洁房
export function sanitaryRoom(data) {
  return request({
    url: '/project/zxm/room/sanitary',
    method: 'post',
    data: data
  })
}

//查询正在打扫的
export function getClean() {
  return request({
    url: '/project/zxm/room/clean',
    method: 'get'
  })
}

//留房
export function leaveRoom(roomNumber) {
  return request({
    url: '/project/zxm/room/reservation/',
    method: 'post',
    data: roomNumber
  })
}

//查询需要叫醒的
export function getWake() {
  return request({
    url: '/project/zxm/room/wake',
    method: 'get'
  })
}
//查询所有状态的房间
export function getStatus() {
  return request({
    url: '/project/zxm/room/status/count',
    method: 'get'
  })
}

//查询项目信息
export function getJoin(roomNumber) {
  return request({
    url: '/project/zxm/room/join/',
    method: 'post',
    data: roomNumber
  })
}

export function getRouter(menuId) {
  return request({
    url: '/library/zxm/application/router/' + menuId,
    method: 'get'
  })
}

export function uploadFile(file) {
  const formData = new FormData(); // 创建 FormData 对象
  formData.append('file', file); // 将文件添加到 FormData 中
  return request({
    url: '/project/zxm/api/upload',
    method: 'post',
    data: formData, // 将 FormData 对象作为请求的 data 参数
    headers: { // 设置请求头，指定请求为多部分请求
      'Content-Type': 'multipart/form-data'
    }
  });
}




//修改word
export function updateFile() {
  return request({
    url: '/project/zxm/api/process/',
    method: 'get'
  })
}
//转换为pdf
export function transFile() {
  return request({
    url: '/project/zxm/api/transposrt/',
    method: 'get'
  })
}




//根据menuID查找这条list的信息
export function getNumber(number) {
  return request({
    url: '/project/zxm/room/status/' + number,
    method: 'get'
  })

}
